#ifndef DOUBAN_MINIBLOG_USERICONLABEL_H
#define DOUBAN_MINIBLOG_USERICONLABEL_H

#include <QLabel>
#include <QMenu>
namespace Douban
{
	class DoubanContext;
	class MiniBlogEntry;
	class UserIconLabelMenu : public QMenu
	{
		public:
			UserIconLabelMenu(DoubanContext* c):m_context(c){}
			DoubanContext* m_context;
	};

	class UserIconLabel : public QLabel
	{
		public:
			explicit UserIconLabel(QWidget* p = 0);
			void setRelatedEntry(MiniBlogEntry* e){m_entry = e;}

			static void InitMenu(DoubanContext*);
			static void DestroyMenu();

		protected:
			void mousePressEvent(QMouseEvent*);
			void contextMenuEvent(QContextMenuEvent*);
		private:
			static QAction* M_MailAct;
			static QAction* M_ReplyAct;
			static QAction* M_ViewWebAct;
			static MiniBlogEntry* M_TriggerMenuInstance;
			static UserIconLabelMenu* M_Menu;

			MiniBlogEntry* m_entry;

			friend class UserIconLabelMenu;
	};
}
#endif // USERICONLABEL_H
